#ifndef UNITTEST_H
#define UNITTEST_H

#ifndef DISABLE_QUICKUNITTEST
#include "QutCase.h"
#include "QutFunction.h"
#include "QutRunner.h"
#define QUT_EVENT(sev, rel, exp, act) testFunction.isActive() ? QutCase(sev, rel, #exp, exp, #act, act, __LINE__) : QutCase(false)
#define QUT_ADD(event)          { if (testFunction.isActive()) testFunction.add(event); }

#define QUT_INSTANCE(CLASS)     { CLASS instance; (void)instance; }
#define QUT_TEST(EXPR)          { EXPR; }
#define QUT_FUNCTION()          QutFunction testFunction(Q_FUNC_INFO, __FILE__, __LINE__);
#define QUT_CODE(EXPR)          EXPR;
#define QUT_EXPECT(act)         { QUT_ADD(QUT_EVENT(QutCase::Expect, QutCase::True, true, act)); }
#define QUT_EXPECTEQ(exp, act)  { QUT_ADD(QUT_EVENT(QutCase::Expect, QutCase::Equal, exp, act)); }

#else // DISABLE_QUICKUNITTEST
#define QUT_INSTANCE(CLASS)
#define QUT_TEST(EXP)
#define QUT_FUNCTION()
#define QUT_ADD(event)
#define QUT_EXPECT(exp, act)

#endif // DISABLE_QUICKUNITTEST

#endif // UNITTEST_H
